package com.zzyl.nursing.member.controller;


import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;



/**
 * 小程序端查询护理项目
 */
@RestController
@RequestMapping("/member/orders/project")
public class MemberProjectController extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;

    @GetMapping("/page")
    public TableDataInfo list(NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }

    //根据id查询护理项目详情
    @GetMapping("/{id}")
    public AjaxResult getInfo(@ApiParam(value = "护理项目ID", required = true)
                              @PathVariable("id") Long id)
    {
        return success(nursingProjectService.selectNursingProjectById(id));
    }
}
